<?php
	//接受ID
	$id=$_GET['id'];

	//链接数据库
	$link=mysqli_connect('localhost','root','');
	//设置链接字符集
	mysqli_set_charset($link,'utf8');
	//选择数据库 
	mysqli_select_db($link,'studynote');
	//准备sql语句
	$sql="select * from note where id=$id";
	//执行SQL语句
	$res=mysqli_query($link,$sql);
	//处理结果
	if($res){
		$row=mysqli_fetch_assoc($res);
	}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>修改</title>
	<style type="text/css">
		.form{border: 1px solid #eeeeee;width: 80%;margin: 5px auto;text-align: left;font-size: 16px;clear: both;}
		.form .input_title{border: 1px solid #c8cccf;font-size:1.4em;height:1.4em;width:80%;margin-left: 10px;}
		.form textarea{border:1px solid gray;padding: 5px 3px 3px 5px;height: 100px;width:80%;margin-left:10px;overflow: scroll;font-size: 1.4em}
		.form p{margin:5px;}
		.form p label{font-size: 20px;}
		input[type='submit']{border: 0;height:50px;width:60px;vertical-align: middle;margin-left: 10px;margin-top:10px;margin-bottom:10px;line-height: 18px;font-size: 18px;cursor:pointer;}
	</style>
</head>
<body>
	<div class="form">
		<form action="doaction.php" method="post">
		<input type="hidden" name='id' value="<?php echo $row['id'];?>">
			<p>
				<label>标题:</label> 
				<input type="text" name="title" class="input_title" value="<?php echo $row['title'];?>">
			</p>
			<p>
				<label>内容:</label> <textarea name="content"><?php echo $row['content'];?></textarea>
			</p>
			<input type="submit" value="修改">
		</form>
	</div>
</body>
</html>